package com.googlecode.cannedbeans.generator.core.strategies;

import com.googlecode.cannedbeans.generator.core.exceptions.MissingPropertyException;
import com.googlecode.cannedbeans.generator.core.exceptions.UnsupportedConstraintException;
import com.googlecode.cannedbeans.generator.model.Constraint;
import com.googlecode.cannedbeans.generator.model.ConstraintType;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author Kim
 */
public interface GenerationStrategy <T> {
    /* TODO: maybe split the implementation further into GenerationStrategy <T, GenerationType>
     * Where GenerationType is enum consisting of ValidValue, InvalidValue, LimitingValue.
     * Perhaps even SingleValidValue, which only respects one specific constraint, 
     * but ignores the others, or purposfully violates the others.
     * However, let's get this shit generating valid values first before I overengineer this any further :p
    */
    T generateValidValue( Map < ConstraintType, Constraint > constraints) throws UnsupportedConstraintException, MissingPropertyException;
    T generateInvalidValue ( Map < ConstraintType, Constraint > constraints, Constraint constraintToViolate) throws UnsupportedConstraintException, MissingPropertyException;
    T generateLimitingValue ( Map < ConstraintType, Constraint > constraints, Constraint limitingConstraint) throws UnsupportedConstraintException, MissingPropertyException;
    Set < ConstraintType > getSupportedConstraintTypes();
}
